<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <input id="user" placeholder="账号" type="text" >
  <input id="pass" placeholder="密码" type="text" >
  <button id="regi">注册</button>
  <button id="save">确认</button>
</body>
<script src="./jquery-3.6.0.min.js"></script>
<script>
  $("#regi").on("click",()=>{
    let user = $('#user').val();
    let pass = $('#pass').val();
    let data = {
      name: user,
      password: pass,
    }
    $.ajax({
      type:"POST",
      url:"http://localhost:1234/Registra",
      data: data,
      success: function(res){
        console.log(res,'----res')
      }
    })
  })
  
  $("#save").on("click",()=>{
    let user = $('#user').val();
    let pass = $('#pass').val();
    let data = {
      name: user,
      password: pass,
      age: "123",
      six: "1",
    }
    $.ajax({
      type:"POST",
      url:"http://localhost:1234/Login",
      data: data,
      success: function(res){
        console.log(res,'----res')
      }
    })
  })
</script>
</html>